<html>
<head><meta charset="utf-8"><title>Result-wrapped feature-gate annotation? · t-compiler/wg-diagnostics · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/index.html">t-compiler/wg-diagnostics</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped.20feature-gate.20annotation.3F.html">Result-wrapped feature-gate annotation?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204724310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped%20feature-gate%20annotation%3F/near/204724310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped.20feature-gate.20annotation.3F.html#204724310">(Jul 22 2020 at 21:19)</a>:</h4>
<p>I was matching on a function that returned <code>Result&lt;(), foo&gt;</code> and when I wrote  the Ok arm like <code>Ok()=&gt;</code> instead of <code>Ok(()) =&gt;</code> I got this interesting message:</p>
<div class="codehilite"><pre><span></span><code>error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 1 field
   --&gt; src/main.rs:123:13
    |
123 |             Ok() =&gt; {
    |             ^^^^ expected 1 field, found 0
    |
   ::: /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/result.rs:250:5
    |
250 |     Ok(#[stable(feature = &quot;rust1&quot;, since = &quot;1.0.0&quot;)] T),
    |     --------------------------------------------------- tuple variant defined here
    |
help: missing parenthesis
    |
123 |             Ok(()) =&gt; {
    |               ^  ^

error: aborting due to previous error
</code></pre></div>



<a name="204724403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped%20feature-gate%20annotation%3F/near/204724403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped.20feature-gate.20annotation.3F.html#204724403">(Jul 22 2020 at 21:20)</a>:</h4>
<p>Is the</p>
<div class="codehilite"><pre><span></span><code>250 |     Ok(#[stable(feature = &quot;rust1&quot;, since = &quot;1.0.0&quot;)] T),
    |     --------------------------------------------------- tuple variant defined here
</code></pre></div>


<p>part supposed to look like that (with the feature gate or whatever that is) inside? It looks a bit confusing in my opinion..</p>



<a name="204760964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped%20feature-gate%20annotation%3F/near/204760964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yuki Okushi <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped.20feature-gate.20annotation.3F.html#204760964">(Jul 23 2020 at 05:03)</a>:</h4>
<p>yeah it'd be nicer that we didn't emit this, <span class="user-mention" data-user-id="217864">@matthiaskrgr</span> could you file it if we don't have a similar issue?</p>



<a name="204775246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped%20feature-gate%20annotation%3F/near/204775246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped.20feature-gate.20annotation.3F.html#204775246">(Jul 23 2020 at 09:13)</a>:</h4>
<p>done: <a href="https://github.com/rust-lang/rust/issues/74673">https://github.com/rust-lang/rust/issues/74673</a> :)</p>



<a name="204782368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped%20feature-gate%20annotation%3F/near/204782368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yuki Okushi <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped.20feature-gate.20annotation.3F.html#204782368">(Jul 23 2020 at 10:49)</a>:</h4>
<p>thanks!</p>



<a name="206880169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped%20feature-gate%20annotation%3F/near/206880169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped.20feature-gate.20annotation.3F.html#206880169">(Aug 13 2020 at 22:43)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/65515">https://github.com/rust-lang/rust/issues/65515</a> :)</p>



<a name="206880274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped%20feature-gate%20annotation%3F/near/206880274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/Result-wrapped.20feature-gate.20annotation.3F.html#206880274">(Aug 13 2020 at 22:44)</a>:</h4>
<p>The conversation is at <a href="https://github.com/rust-lang/rust/pull/71481">https://github.com/rust-lang/rust/pull/71481</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>